import {
	computed,
	ref
} from 'vue';
import {
	onUnload
} from "@dcloudio/uni-app";

import appSite from '@/utils/appSite';
export  function initTheme() {
	let app_theme = ref(appSite.theme);

	//监听主题变化
	uni.$on("app_theme_change", (data) => {
		app_theme.value = data;
	})
   
	onUnload(() => {
		uni.$off("app_theme_change");
	})

	return {
		app_theme
	}

}